1. Field of the Invention
The present invention relates to a method system, program, and data structures for configuring arrays in a storage device.
2. Description of the Related Art
A storage controller system-manages the input/output (I/O) requests from numerous host systems to a large storage space, such as a Direct Access Storage Device (DASD) comprised of numerous interconnected hard disk drives. The host systems view the storage space as a series of logical unit numbers (LUNs). For instance, with the Small Computer System Interface (SCSI), the host device driver would include the LUN number with the I/O request to access a logical block address (LBA) within the LUN. The storage controller maintains a mapping of LUNs to actual physical disks in the DASD. In this way, the storage controller maps the requested LBA in a LUN to a particular sector in a disk.
In prior art systems, the storage controller maintains configuration data indicating the mapping of LUN numbers to sectors in the disks in the DASD. The storage controller maintains a single map of LUNs to the physical storage space or storage subsystem that is used by all attached hosts. In this way all hosts use the same LUN numbers to refer to the same physical storage space via the storage controller. If an array of disks is removed, then the LUN numbers that previously mapped to that array would become NULL as the data is no longer present. If an array of disks are added to the DASD unit, then the storage controller would have increased physical storage space to use for future LUNs that the hosts create. However, any data and LUN configurations that were previously embedded in the disk array added to the DASD are lost because the storage controller does not maintain LUN mappings to a newly added array. Only upon receiving a request from a host to add a LUN would the storage controller then map a new LUN number to the new space in the added array.
There is a need in the art to provide an improved technique for managing the mapping of LUN numbers to physical storage space to provide greater flexibility in the use of the storage space.
To overcome the limitations in the prior art described above, preferred embodiments disclose a method, system, program, and data structures for mapping logical units to a storage space comprised of at least one array of storage units. Configuration information stored in one array indicating a first mapping of logical units to storage locations in the array is read. A second mapping of logical units to storage locations in multiple arrays is generated using the configuration information read from the array. Each logical unit is assigned to only one of the arrays.
In further embodiments, a request is received to add a logical unit that maps to a range of blocks in a target array. A determination is made of one logical unit available in the second mapping that does not map to a storage location in one array. The first mapping is modified to indicate that the determined logical unit maps to a range of blocks in the target array. Further, the second mapping is modified to indicate that the determined logical unit maps to the target array.
In still further embodiments, the configuration information for each array in the storage space is read. The second mapping is generated by determining, for each array, each logical unit in the first mapping that maps to a storage location in the array. The determined logical unit in the second mapping is used to map to the storage location in the array as indicated in the first mapping if the second mapping does not already use the determined logical unit to map to another array.
In certain embodiments, the configuration information is read from each array in response to a coldstart operation. Alternatively, the configuration information is read upon detecting a change in the arrays included in the storage space.
Preferred embodiments provide a logical unit number (LUN) configuration in the arrays so that the storage space, including multiple arrays, is configured using the configuration information maintained in the arrays themselves. In this way, the arrays are self-contained and defined storage entities. If an array is added to a storage space, then the configuration of that array, as stored in the array, is used to add the array""s self-defined configuration to the storage space. Thus, the LUN configuration and data stored in the added array are accessible as part of the storage space.